package homework;

public class Work9 {
    public static void main(String[] args) {
        int providentFund=2000;
        Staff staff1 = new Staff("ls","f",10000);

        staff1.print();
        staff1.salaryAfterTax(providentFund);



    }
}
class Staff{
    String name;
    String sex;
    int ID;
    static int count=10001;
    double salary;
    double salaryTax;//税后工资

    {
        ID=count++;

    }

    //打印员工属性
    public void print(){
        System.out.println(this.name+"  "+this.sex+"  "+this.ID+"  "+this.salaryTax);
    }

    //求实际工资
    public void salaryAfterTax(int providentFund){
        this.salaryTax=this.salary-providentFund;
        System.out.println(salaryTax);
    }


    //以下全部都是构造器


    public Staff() {
    }

    public Staff(String name, String sex) {
        this.name = name;
        this.sex = sex;
    }

    public Staff(String name, String sex, double salary) {
        this.name = name;
        this.sex = sex;
        this.salary = salary;
    }
}

